home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / ANSI.SWG / 0014_Display THEDRAW BIN File.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  70 lines

  1. {
  2. Here are the relevant pieces from a Program I wrote to convert TheDraw
  3. .Bin Files to .ANS Files.  Why?  TheDraw's .ANSI Files are incredibly
  4. wasteful!  The display speed of the menus of the BBS I wrote this For
  5. now redraw at 300% the speed they used to!
  6.  
  7. if you (or anyone) wants the full Program, give me a yell.
  8. }
  9.  
  10. Program Bin2Ansi;
  11.  
  12. Uses
  13.   Crt,Dos;
  14.  
  15. Var
  16.   Filenum   :Byte; {Points to the command line parameter now being looked at}
  17.   fName     :String;  {File from cmd line - possibly With wildcards}
  18.   Filesdone :Word;
  19.  
  20.   Procedure ParseFile (Var cmdFName:String);
  21.  
  22.   Var
  23.     Details:SearchRec;
  24.     fDir, fName, fExt:String;
  25.     Dummy:String;
  26.     {The parts of the name of the source .Bin File}
  27.  
  28.   begin
  29.     {Default extension}
  30.     if pos ('.',cmdFName) = 0 then cmdFName := cmdFName + '.Bin';
  31.     FSplit(cmdFName, fDir, dummy, dummy); {Get the directory name}
  32.     {Check to see if we have any matches For this Filespec}
  33.     FindFirst (cmdFName,AnyFile,Details);
  34.     if DosError <> 0 then begin
  35.       Writeln ('Filespec: ',cmdfname);
  36.       error (7,warning);
  37.     end else begin
  38.       While DosError = 0 do begin
  39.         FSplit(fdir+details.name, dummy, fName, fExt); {Get the directory name}
  40.         assign (BinFile,fdir+details.name);
  41.         Write ('Opening File: ',details.name,#13);
  42.         {$i-}
  43.         reset (BinFile);
  44.         {$i+}
  45.         end else begin
  46.           Writeln (details.name,' --> ',fname,'.ANS  ');
  47.           process (BinFile,fdir+fname+'.ANS');
  48.           close (BinFile);
  49.         end;
  50.         FindNext (Details);
  51.       end;
  52.     end;
  53.   end;
  54.  
  55. begin
  56.   directvideo := False;
  57.   Filesdone := 0;
  58.   header;
  59.   if paramcount < 1 then error (1,fatal);
  60.   FileNum := 0;
  61.   Repeat
  62.     fname := paramstr (Filenum + 1);
  63.     ParseFile (fname);
  64.     inc (FileNum);
  65.   Until paramstr (FileNum + 1) = '';
  66.   Writeln; Write (' ■ Done, With ',Filesdone,' File');
  67.   if Filesdone <> 1 then Write ('s');
  68.   Writeln (' processed.');
  69. end.
  70.